﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
namespace IHISCETeim.Web.MachineSys.ProdModel
{
    public partial class PToolingChargeAdd : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.新增 };
            }
        }
        protected override string DWZRef
        {
            get { return "PToolingChargeList"; }
        }

        #region
       
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetRequestValue<string>("ajaxmethod", "") == "add")
            {
                addmenu();
                
            }
        }

        protected void addmenu()
        {
            PToolingChargeInfo obj2 = Request.SerializableObject<PToolingChargeInfo>();
            obj2.SupplerName = GetRequestValue<string>("dwz.ptcLookup.SupplerName", "");
            obj2.AddRealName = User.RealName;

            if (PToolingChargeController.IsExist(obj2.ItemCode)>0)
            {
                AlertJson("此物料号已添加过.不能重复添加");
                return;
            }

            this.AddLog(Permission.新增,"",obj2);
            if (PToolingChargeController.Add(obj2)>0)
                SuccessJson("添加成功");
            else
                ErrorJson("添加失败");
        }
    }
}